#pragma once

#include "IResourceObject.h"
#include "IRenderable.h"
#include "SceneNode.h"
#include "MacroDefs.h"
#include <d3dx9.h>


class CResourceText: public CSceneNode, public IResourceObject, public IRenderable
{
	private:
		char*	_fontName;
		int		_size;
		bool	_bold;
		bool	_italic;
		bool	_underline;

		LPD3DXFONT		_dxFont;


	protected:
		char*	_text;

	public:
		CResourceText();
		~CResourceText();


		bool CreateFont(const char* font, int size, bool bold = false, bool italic = false, bool underline = false);

		char* Text(char* text);

		bool OnInitResource(ICompHandler* handler);
		bool OnFreeResource(ICompHandler* handler);

		void Render(LPDIRECT3DDEVICE9 rendererDevice, D3DXMATRIX*);

		bool IsRenderable() { return true; }
};